How to get historical closing price for ric *=RRPS through Eikon API with python?

I am trying to get the historical closing price for *=RRPS (e.g. AT0000A1K9C8=RRPS, BE352=RRPS)


df_r,e = ek.get_data(' BE291=RRPS' ,['TR.PriceClose'],

{'SDate':'2022-01-01','EDate':'2022-06-30','Frq':'D'})

CF_CLOSE doesn't work for historical prices

screenshot-2022-07-12-162814.jpg

I tried ek.get_timeseries but it returned the close yield.

df = ek.get_timeseries([ 'BE352=RRPS' ] ,fields="CLOSE" , start_date = '2022-01-01', end_date = '2022-06-30')


2.jpg


Best Answer

  • Hi @rinnie.cheung ,


    Please use the DIB to find the field that you are after. You can use the cog (top right) to filter for series datapoints for which you can look for historical data:


    1657705367252.png



    import refinitiv.data as rd
    rd.open_session()
    df3 = rd.get_history(
    universe=["BE291=RRPS"],
    fields=["TR.MIDPRICE", "TR.MIDYIELD"],
    interval="1D",
    start="2021-10-01",
    end="2022-06-01",
    )
    display(df3)
    rd.close_session()

    1657705540705.png


    Daily data using the rd.get_history function returns end-of-day datapoints, be it Bid, Ask or Mid, apart from if mentioned otherwise in the DIB.

Answers

  • Hi @rinnie.cheung

    Can you provide the version of the Eikon Data API you are using? When I tried the code snippets you posted above, the opposite worked for me. For example:

    ahs.png

  • My Eikon API version is 1.1.14. the values in your numbers are yield, but i am looking for the pricescreenshot-2022-07-13-082903.jpg

    if you check Eikon, the price should be a double digit value.

    Would you please advise?

  • My Eikon API version is 1.1.14. the values in your numbers are yield, but i am looking for the price


    image

    if you check Eikon, the price should be a double digit value.

    Would you please advise?

  • would that be equivalent to
    df_r,e = ek.get_data(' BE291=RRPS' ,['TR.BidPrice.Date','TR.BidPrice','TR.AskPrice'],

    {'SDate':'2022-01-01','EDate':'2022-06-30','Frq':'D'})


    do these fields capture the last bidprice and last ask price of the day?

  • Hi @rinnie.cheung , yes it is the same. Data comes from the same endpoints.
  • Thanks Jonathan. Would you know the timestamp when these data were captured?
  • This would be a content question, please reach out to myRefinitiv where you will be able to ask this question.
  • Thanks for your help!